{
  Визуальные элементы отображения структурных схем

 TVislSchemeView - Статическая картинка
 TVislDynamicView - Анимированная картинка

   версия 0.1 декабрь 2010 prodg@ya.ru D.Kondakov
}
unit VislSchemeView;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, VislObjects;

type
  TVislSchemeView = class(TGraphicControl)
  private
    { Private declarations }
    vsElements: TCollection;
    function GetItem(i: integer): TVisualElement;
  protected
    { Protected declarations }
    procedure Paint; override;
    property Elements[Index: integer]: TVisualElement read GetItem;
  public
    { Public declarations }
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Published declarations }
    property Align;
    property Anchors;
    property BorderSpacing;
    property Constraints;
    property Visible;
  end;

  TVislDynamicView = class(TVislSchemeView)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
  published
    { Published declarations }
    property UpdatePeriod: byte;
    property InRun: boolean;
  end;

procedure Register;

implementation

constructor TVislSchemeView.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  SetInitialBounds(0,0,50,50);
  vsElements.Create(TVisualElement);


end;

destructor TVislSchemeView.Destroy;
begin

  vsElements.Free;
  inherited;
end;

procedure TVislSchemeView.Paint;
begin
  if csDesigning in ComponentState then begin
    with Canvas do
    begin
      Pen.Style := psDash;
      Pen.Color:=clBlack;
      Brush.Style := bsClear;
      Brush.Color := Color;
      Rectangle(0, 0, Self.Width - 1, Self.Height - 1);
      Line(0,0,Self.Width-1,Self.Height-1);
      Line(Self.Width-1,0,0,Self.Height-1);
    end;
    exit;
  end;
  with Canvas do begin
    Pen.Color:=clBlack;
    Brush.Style := bsClear;
    Brush.Color := Color;
    Rectangle(0, 0, Self.Width - 1, Self.Height - 1);

  end;
  inherited;
end;

function TVislSchemeView.GetItem(i: integer): TVisualElement;
begin

end;

procedure Register;
begin
//  {$I vislschemeview.lrs}
  RegisterComponents('Additional',[TVislSchemeView,TVislDynamicView]);
end;

end.
